package org.jeecg.modules.iot.utils;

import com.alibaba.fastjson.JSONObject;

/**
 * 对接抗疫情Api的工具类
 */
public class KyqApiUtils {
    /**
     * 抗疫情接口1
     * 参数为：
     * {
     * 	"userNo": "",人员编号
     * 	"name": "",人员姓名
     * 	"temperature": 36.7,体温
     * 	"sn": "G60838985",抗疫情中登记的设备sn
     * 	"serialNo": 23,设备发起的序列化
     * 	"direction ": 1,方向
     * 	"verifyType": 2,认证方式 2为人脸
     * 	"picture": "data:image/jpg;base64,",
     * 	"cardNo": ""
     * }
     */
    public static final String SN="G60838985";
    public static final String API_REMOTECHECK="http://106.60.78.73:9000/turnstile/remoteCheck";
    public static final String API_NUCLEICACIDTEST="http://106.60.78.73:9000/turnstile/nucleicAcidTest";

    public static JSONObject remoteCheck(JSONObject prams){
        return JSONObject.parseObject(HttpUtils.httpPost(API_REMOTECHECK,prams));
    }
    public static JSONObject nucleicAcidTest(JSONObject prams){
        return JSONObject.parseObject(HttpUtils.httpPost(API_NUCLEICACIDTEST,prams));
    }

    /**
     * 人脸核验
     * @param faceBase64
     * @return
     */
    public static JSONObject faceCheck(String faceBase64){
        JSONObject prams=new JSONObject();
        prams.put("userNo","");
        prams.put("cardNo","");
        prams.put("name","");
        prams.put("temperature",36.7);
        prams.put("sn",SN);
        prams.put("serialNo",1);
        prams.put("direction",1);
        prams.put("verifyType",2);
        prams.put("picture",faceBase64);
        return JSONObject.parseObject(HttpUtils.httpPost(API_REMOTECHECK,prams));
    }



}
